package com.text.day3_3.homework;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class QiuMap {
    public static void main(String[] args) {
        HashMap<String,String> hashMap = new HashMap<>();
        hashMap.put("2006","意大利");
        hashMap.put("2002","巴西");
        hashMap.put("1998","法国");
        hashMap.put("1994","巴西");
        hashMap.put("1990","德国");
        hashMap.put("1986","阿根廷");
        hashMap.put("1982","意大利");
        hashMap.put("1978","阿根廷");
        hashMap.put("1974","德国");
        hashMap.put("1970","巴西");
        hashMap.put("1966","英格兰");
        hashMap.put("1962","巴西");
        hashMap.put("1958","巴西");
        hashMap.put("1954","德国");
        hashMap.put("1950","乌拉圭");
        hashMap.put("1938","意大利");
        hashMap.put("1934","意大利");
        hashMap.put("1930","乌拉圭");



        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        if (hashMap.get(str) == null)
            System.out.println("没有举办世界杯");
        else
            System.out.println(hashMap.get(str));
        String st = scanner.next();
//        System.out.println(hashMap);
        if (hashMap.containsValue(st))
            hashMap.forEach((k,v) -> {
                if (st.equals(v))         //lamba里必须要final
                    System.out.print(k + " ");
            });
        else
            System.out.println("没有获得过世界杯");



    }
}
